Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

This works for us

Creates a PDF using the window title as the file name and attaches it to a mail document which is displayed to the user.

Looks like the code has been modified over ther years and area and nextStatus are no longer used.

You have to have Adobe PDF installed as a printer

Printing Preferences
Adobe PDF Settings tab
Uncheck View Adobe PDF results

Action on a form

Sub Click(Source As Button)

Call NotifyFLS(doc, "", "")

End Sub

Script Library

Sub NotifyFLS (doc As NotesDocument, area As Variant, nextStatus As String)

On Error Goto errTrap

Dim uidoc As NotesUIDocument
Dim mailFile As Variant
Dim mailDb As NotesDatabase
Dim mailDoc As NotesDocument
Dim body As NotesRichTextItem
Dim isMailDb As Boolean
Dim reportSubject As String
Dim reportFile As String
Dim x As Variant

Set uidoc = ws.CurrentDocument
Call uidoc.Print(1, 0, 0, False, "Adobe PDF")
Sleep 1

mailFile = Evaluate("@MailDbName")
Set mailDb = session.GetDatabase(mailFile(0), mailFile(1))
Set mailDoc = mailDb.CreateDocument
mailDoc.SendTo = YourRecipient
mailDoc.SendTo = Arrayunique(Arrayappend(mailDoc.SendTo, YourRecipient))
mailDoc.SendTo = Arrayunique(Arrayappend(mailDoc.SendTo, Your Recipient))
mailDoc.Form = "Memo"

reportSubject$ = "YourSubject"
mailDoc.Subject = reportSubject$

Set body = New NotesRichTextItem(mailDoc, "body")

reportFile$ = "C:\Temp\" & uidoc.WindowTitle & ".pdf"

Call body.AddNewline(2)
Call body.EmbedObject(EMBED_ATTACHMENT, "", reportFile$)
Call ws.EditDocument(True, mailDoc)
Sleep 1
Kill reportFile$

errTrap:
If Err = 4433 Then
Messagebox "You do not have the Adobe PDF printer installed.", MB_OK, "Printer Error"
Exit Sub
Else
Set mailDoc = New NotesDocument( db )
mailDoc.Form = "Memo"
mailDoc.SendTo = YourRecipient
mailDoc.Subject = db.Title & " - Action: " & "Adobe PDF" & " - Failed"
mailDoc.Body = "Error #: " & Err & "; Error: " & Error & " Line: " & Erl
Call mailDoc.Send( False )
Msgbox "Module: " & Getthreadinfo(1) & "; Error #: " & Err & "; Error: " & Error & " Line: " & Erl
Exit Sub
End If

End Sub


Feedback response number WEBBAE7KBS created by ~Sigmund Zekfreezenobu on 09/27/2016

Notes Document to PDF (~Hal Quetlu 9.Sep.16)
. . I personally would use a print driv... (~Fritz Ekfoober... 9.Sep.16)
. . . . Hmm..I have no idea how I would go ... (~Hal Quetlu 9.Sep.16)
. . . . . . Not particularly easy, either (~Sigmund Umwema... 11.Sep.16)
. . . . . . It is worth the trouble to try this... (~Sigmund Umwema... 12.Sep.16)
. . . . . . Actually, I was too vague. (~Sigmund Umwema... 16.Sep.16)
. . There are numerous issues with Word... (~Sigmund Umwema... 11.Sep.16)
. . This works for us (~Sigmund Zekfre... 27.Sep.16)
. . . . Thank you (~Hal Quetlu 30.Sep.16)
. . Third-party tools (~Fred Asatumibu... 12.Sep.16)
. . . . Third party tools (~Wei Desfreebur... 12.Sep.16)
. . Easily export to PDF, Word, HTML (~Lorraine Nimji... 13.Oct.16)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS